<?php

/* ----------------------------SYSTEM CONFIGURATION-------------------- */

/*
  |--------------------------------------------------------------------------
  | admin name
  |--------------------------------------------------------------------------
 */
$config['system']['admin_name'] = '';

/*
  |--------------------------------------------------------------------------
  | Timezone setting
  |--------------------------------------------------------------------------
 */
$config['system']['time_zone'] = 'Australia/Brisbane';

/*
  |--------------------------------------------------------------------------
  | admin email
  |--------------------------------------------------------------------------
 */
$config['system']['admin_email'] = '';

/*
  |--------------------------------------------------------------------------
  | all live domain ext
  |--------------------------------------------------------------------------
 */
$config['system']['live_domain_ext'] = array(
    'aero', //air-transport industry
    'asia', //Asia-Pacific region
    'biz', //business
    'cat', //Catalan
    'com', //commercial
    'coop', //cooperatives
    'info', //information
    'int', //international organizations
    'jobs', //companies
    'mobi', //mobile devices
    'museum', //museums
    'name', //individuals, by name
    'net', //network
    'org', //organization
    'pro', //professions
    'tel', //Internet communication services
    'travel', //travel and tourism industry related sites
    'xxx', //adult entertainment
    'edu', //educational
    'gov', //governmental
    'mil', //US military
    'au', //Australia
    'uk', //United Kingdom
    'us', //USA
    'nz',
    'cn', //China
    'jp', //Japan
);
/* ----------------------------END SYSTEM CONFIGURATION-------------------- */

/* ----------------------------APPLICATION CONFIGURATION-------------------- */

/*
  |--------------------------------------------------------------------------
  | Application name
  |--------------------------------------------------------------------------
 */
$config['app']['app_name'] = 'CMS POWERBOARD';

/*
  |--------------------------------------------------------------------------
  | Application version
  |--------------------------------------------------------------------------
  | Application version for current system
 */
$config['app']['version'] = '1';

/*
  |--------------------------------------------------------------------------
  | Application base url
  |--------------------------------------------------------------------------
  | Application base url , for instance http://abc.com or https://abc.com
 */
$config['app']['url'] = Util::getUrl(); 

/*
  |--------------------------------------------------------------------------
  | Application raw url
  |--------------------------------------------------------------------------
  | Application raw url , for instance abc.com
 */
$config['app']['raw_url'] = $_SERVER['HTTP_HOST'];

/*
  |--------------------------------------------------------------------------
  | Application root
  |--------------------------------------------------------------------------
  | Application root which indicate where application is present in local file system
 */
$config['app']['root'] = PATH_BASE;

/*
  |--------------------------------------------------------------------------
  | Application default language
  |--------------------------------------------------------------------------
  | Application default language for I18N purpose
 */
$config['app']['language'] = 'english';


/*
  |--------------------------------------------------------------------------
  | Allowed special characters
  |--------------------------------------------------------------------------
  | All allowed special characters represented in regular expression manner,
  Mainly will be used for routering url matching controllers
 */
$config['app']['url_special_chars'] = " _\+&\?\=,.~;#\[\]\\\@\'!*:-";


/*
  |--------------------------------------------------------------------------
  | Allowed URL Characters
  |--------------------------------------------------------------------------
  |
  | This lets you specify with a regular expression which characters are permitted
  | within your URLs.  When someone tries to submit a URL with disallowed
  | characters they will get a warning message.
  |
  | As a security measure you are STRONGLY encouraged to restrict URLs to
  | as few characters as possible.  By default only these are allowed: a-z 0-9~%.:_-
  |
 */
$config['app']['permitted_uri_chars'] = 'a-z 0-9~%.:_\-';

/*
  |--------------------------------------------------------------------------
  | module uri segment
  |--------------------------------------------------------------------------
  | get params to indicate which module to use only used in regular url not MOD REWRITE
 */
$config['app']['module_uri_segment'] = 'm';

/*
  |--------------------------------------------------------------------------
  | controller uri segment
  |--------------------------------------------------------------------------
  | get params to indicate which class to use only used in regular url not MOD REWRITE
 */
$config['app']['controller_uri_segment'] = 'c';

/*
  |--------------------------------------------------------------------------
  | action uri segment
  |--------------------------------------------------------------------------
  | get params to indicate which action to use only used in regular url not MOD REWRITE
 */
$config['app']['action_uri_segment'] = 'a';


$config['app']['module_url'] = $config['app']['url'].'/src/Module';
/* 
  |--------------------------------------------------------------------------
  | Library path
  |--------------------------------------------------------------------------
  | Path of all library which application will use
 */
$config['app']['library_path'] = SRC_DIR . DS . 'Library';

/*
  |--------------------------------------------------------------------------
  | Thrid Party path
  |--------------------------------------------------------------------------
  | Path of all thrid party libraries which application will use
 */
$config['app']['third_party_path'] = SRC_DIR . DS . 'ThirdParty';


/*
  |--------------------------------------------------------------------------
  | Module path
  |--------------------------------------------------------------------------
  | Path of all library which application will use
 */
$config['app']['module_path'] = SRC_DIR . DS . 'Module';

/*
  |--------------------------------------------------------------------------
  | log path
  |--------------------------------------------------------------------------
  | log path for current application, this is an relative setup
 */
$config['app']['log_path'] = $config['app']['root'] . '/storage/log/error.log';

/*
  |--------------------------------------------------------------------------
  | encryption key
  |--------------------------------------------------------------------------
 */
$config['app']['encryption_key'] = 'cmspowerboard';

/*
  |--------------------------------------------------------------------------
  | development mode
  |--------------------------------------------------------------------------
  | this can be set to test, dev or live
 */
$config['app']['development_mode'] = array('test', 'dev', 'live');

if (defined('DEVELOPMENT_MODE'))
{
    $config['app']['development_mode'] = DEVELOPMENT_MODE;
} else
{
    $urlArray = explode('.', $config['app']['url']);

    $domainExt = $urlArray[count($urlArray) - 1];

    if (in_array($domainExt, $config['system']['live_domain_ext']))
    {
        $config['app']['development_mode'] = LIVE_MODE;
    } else if (strpos($config['app']['url'], 'dev.') !== FALSE)
    {
        $config['app']['development_mode'] = DEV_MODE;
    } else
    {
        $config['app']['development_mode'] = TESTING_MODE;
    }
}

/*
  |--------------------------------------------------------------------------
  | session storage path
  |--------------------------------------------------------------------------
  | to store session file
 */
$config['app']['session_path'] = $config['app']['root'] . DS . 'storage/session';

/* ----------------------------END APPLICATION CONFIGURATION----------------- */

$config['template']['dir'] = SRC_DIR . DS . 'Templates';

$config['template']['url'] = Util::getUrl() . '/src/Templates';

$config['template']['name']= 'Default';

/* ----------------------------Router CONFIGURATION-------------------- */ 

$config['default_module']     = 'Content';

$config['default_controller'] = 'Default';

$config['default_action']     = 'index';

$config['default_router']     = 'Router_Regular';

$config['default_template']   = $config['template']['dir'].DS.$config['template']['name'].DS.'index.php';

$config['routes']             = array(
	
	array('pattern'     =>  '/admin/login', 
              
              'module'      => 'Auth', 
              
              'controller'  => 'Default', 
		
              'action'      => 'login', 
	
              'preciseMatch'=> TRUE),
			  
	array('pattern'     =>  '/admin', 
              
              'module'      => 'Auth', 
              
              'controller'  => 'Default', 
		
              'action'      => 'login', 
	
              'preciseMatch'=> TRUE),
	
	
); 

$config['sections'] = array(
	
    'admin' => array(
        
        'router'        => 'Router_Regular',
        
        'template'      => $config['template']['dir'].DS.'Admin'.DS.'index.php',
        
        'routes'       => array(
	
	array('pattern'     =>  '/admin/login', 
              
              'module'      => 'Auth', 
              
              'controller'  => 'Default', 
		
              'action'      => 'login', 
	
              'preciseMatch'=> TRUE),
			  
	array('pattern'     =>  '/admin', 
              
              'module'      => 'Auth', 
              
              'controller'  => 'Default', 
		
              'action'      => 'login', 
	
              'preciseMatch'=> TRUE),
	
	
        )
    )
);

/* ----------------------------END Router CONFIGURATION-------------------- */


$config['header_title'] = 'FatGalah CMS Powerboard';

/* ----------------------------DATABASE CONFIGURATION-------------------- */
/*
  |--------------------------------------------------------------------------
  | database connection host
  |--------------------------------------------------------------------------
 */
$config['db']['host'] = 'localhost';

/*
  |--------------------------------------------------------------------------
  | database connection username
  |--------------------------------------------------------------------------
 */
$config['db']['username'] = 'root';

/*
  |--------------------------------------------------------------------------
  | database connection password
  |--------------------------------------------------------------------------
 */
$config['db']['password'] = '111111';

/*
  |--------------------------------------------------------------------------
  | database name
  |--------------------------------------------------------------------------
 */
$config['db']['database'] = 'fatgalah';

/* ----------------------------END DATABASE CONFIGURATION-------------------- */


function myloader($class)
{
    try
    {
        $locator = new ServiceLocator();

        $locator->load($class);
    } catch (Exception $e)
    {
        echo $e->getMessage();
    }

}

spl_autoload_register('myloader');